package v1

const (
	SEP      = `:`
	PATH_SEP = `.`

	RPC_SERVICE_CONTAINER = `container`
	RPC_SERVICE_K8S       = `k8s`
	RPC_SERVICE_HELM      = `helm`
	RPC_SERVICE_PROXY     = `proxy`
	RPC_SERVICE_MAAS      = `maas`
	RPC_SERVICE_KUBEVIRT  = `kubevirt`
	RPC_SERVICE_LOG       = `log`
	RPC_SERVICE_PROM      = `prom`
	RPC_SERVICE_JAEGER    = `jaeger`
	RPC_SERVICE_CPROFILE  = `cprofile`
	RPC_SERVICE_DAG       = `dag`

	CONTAINER_RESOURCE                = `container`
	VIRTUAL_MACHINE_RESOURCE          = `vm`
	VIRTUAL_MACHINE_INSTANCE_RESOURCE = `vmi`
	VIRTUAL_MACHINE_SERVICE_RESOURCE  = `vms`
	HELM_RELEASE_RESOURCE             = `release`
	HELM_CHART_RESOURCE               = `chart`
	NAMESPACE_RESOURCE                = `namespace`
)

const (
	RpcVersion        = `v2`
	RpcAgentApiPerfix = RpcVersion + PATH_SEP + `apis` + PATH_SEP + `agent`
)

const (
	GetAgenInfo = RpcAgentApiPerfix + `.agent.info`
)

// container api
const (
	CreateContainer = RpcAgentApiPerfix + PATH_SEP + CONTAINER_RESOURCE + PATH_SEP + `create`
	GetContainer    = RpcAgentApiPerfix + PATH_SEP + CONTAINER_RESOURCE + PATH_SEP + `get`
	DeleteContainer = RpcAgentApiPerfix + PATH_SEP + CONTAINER_RESOURCE + PATH_SEP + `delete`
	UpdateContainer = RpcAgentApiPerfix + PATH_SEP + CONTAINER_RESOURCE + PATH_SEP + `update`
)

// k8s api
const (
	ApplyK8sYaml  = RpcAgentApiPerfix + `.k8s.yaml.apply`
	DeleteK8sYaml = RpcAgentApiPerfix + `.k8s.yaml.delete`
)

// helm api
const (
	CreateHelmRelease = RpcAgentApiPerfix + PATH_SEP + HELM_RELEASE_RESOURCE + PATH_SEP + `create`
	GetHelmRelease    = RpcAgentApiPerfix + PATH_SEP + HELM_RELEASE_RESOURCE + PATH_SEP + `get`
	DeleteHelmRelease = RpcAgentApiPerfix + PATH_SEP + HELM_RELEASE_RESOURCE + PATH_SEP + `delete`
)

// proxy api
const (
	HttpGetProxy     = RpcAgentApiPerfix + `.http.get`
	HttpPostProxy    = RpcAgentApiPerfix + `.http.post`
	HttpProxyRequest = RpcAgentApiPerfix + `.http.request`
)

// log api
const (
	LogCounts = RpcAgentApiPerfix + `.log.counts`
	LogInfo   = RpcAgentApiPerfix + `.log.info`
)

// prom api
const (
	PromQuery      = RpcAgentApiPerfix + `.prom.query`
	PromQueryRange = RpcAgentApiPerfix + `.prom.query_range`
)

// dag api
const (
	DagServiceMap = RpcAgentApiPerfix + `.dag.service_map`
	DagResponse   = RpcAgentApiPerfix + `.dag.response`
)

// jaeger api
const (
	JaegerService = RpcAgentApiPerfix + `.jaeger.service`
	JaegerOperate = RpcAgentApiPerfix + `.jaeger.operate`
	JaegerTraces  = RpcAgentApiPerfix + `.jaeger.traces`
)

// cprofile
const (
	CprofileFlame = RpcAgentApiPerfix + `.cprofile.flame`
	CprofileFile  = RpcAgentApiPerfix + `.cprofile.file`
)

// maas api
// example: v2.apis.agent.maas.boot_resources_search
const (
	MaasBootResourcesSearch      = RpcAgentApiPerfix + `.maas.boot_resources_search`
	MaasSubnetsSearch            = RpcAgentApiPerfix + `.maas.subnets_search`
	MaasVmHostSearch             = RpcAgentApiPerfix + `.maas.vm_host_search`
	MaasVmHostsSearch            = RpcAgentApiPerfix + `.maas.vm_hosts_search`
	MaasVmHostsCreate            = RpcAgentApiPerfix + `.maas.vm_hosts_create`
	MaasVmHostsDelete            = RpcAgentApiPerfix + `.maas.vm_hosts_delete`
	MaasMachineCreate            = RpcAgentApiPerfix + `.maas.machine_create`
	MaasMachineDelete            = RpcAgentApiPerfix + `.maas.machine_delete`
	MaasMachineUpdate            = RpcAgentApiPerfix + `.maas.machine_update`
	MaasMachineSearch            = RpcAgentApiPerfix + `.maas.machine_search`
	MaasMachinesSearch           = RpcAgentApiPerfix + `.maas.machines_search`
	MaasMachinePowerOn           = RpcAgentApiPerfix + `.maas.machine_power_on`
	MaasMachinePowerOff          = RpcAgentApiPerfix + `.maas.machine_power_off`
	MaasMachineDetails           = RpcAgentApiPerfix + `.maas.machine_detail`
	MaasTagsUpdateNodes          = RpcAgentApiPerfix + `.maas.tags_update_nodes`
	MaasMachineDeploy            = RpcAgentApiPerfix + `.maas.machine_deploy`
	MaasSubnetsIPAddressesSearch = RpcAgentApiPerfix + `.maas.subnets_ip_addresses`
)

// kubevirt api
const (
	CreateVirtualMachine = RpcAgentApiPerfix + PATH_SEP + VIRTUAL_MACHINE_RESOURCE + PATH_SEP + `create`
	GetVirtualMachine    = RpcAgentApiPerfix + PATH_SEP + VIRTUAL_MACHINE_RESOURCE + PATH_SEP + `get`
	DeleteVirtualMachine = RpcAgentApiPerfix + PATH_SEP + VIRTUAL_MACHINE_RESOURCE + PATH_SEP + `delete`

	CreateVirtualMachineInstance = RpcAgentApiPerfix + PATH_SEP + VIRTUAL_MACHINE_INSTANCE_RESOURCE + PATH_SEP + `create`
	GetVirtualMachineInstance    = RpcAgentApiPerfix + PATH_SEP + VIRTUAL_MACHINE_INSTANCE_RESOURCE + PATH_SEP + `get`
	DeleteVirtualMachineInstance = RpcAgentApiPerfix + PATH_SEP + VIRTUAL_MACHINE_INSTANCE_RESOURCE + PATH_SEP + `delete`

	CreateVirtualMachineService = RpcAgentApiPerfix + PATH_SEP + VIRTUAL_MACHINE_SERVICE_RESOURCE + PATH_SEP + `create`
	GetVirtualMachineService    = RpcAgentApiPerfix + PATH_SEP + VIRTUAL_MACHINE_SERVICE_RESOURCE + PATH_SEP + `get`
	DeleteVirtualMachineService = RpcAgentApiPerfix + PATH_SEP + VIRTUAL_MACHINE_SERVICE_RESOURCE + PATH_SEP + `delete`
)

// k8s api
const (
	ListContainerInNameSpace = RpcAgentApiPerfix + PATH_SEP + RPC_SERVICE_K8S + PATH_SEP + NAMESPACE_RESOURCE + PATH_SEP + CONTAINER_RESOURCE + PATH_SEP + `list`
)
